package service;


import Dto.GoodsDto;
import model.Goods;
import model.User;

import java.sql.Connection;
import java.util.List;

public interface GoodsService extends BaseService {

    int buyGoods(User user, GoodsDto goodsDto);

    int addAGoods(Goods goods);

    int delAGoods(String id);

    int updateGoods(String id, Goods goods);

    Goods findAGoodsById(String id);

    List<Goods> findGoodsByIds(String ids) throws Exception;

    List<Goods> getGoodsListDb() throws Exception;

    List<Goods> findGoodsByName(String name);

    Boolean checkUserBalanceAndGoodsStockEnough(User user, GoodsDto goodsDto);

    int updateGoodsStock(Connection con, Goods goods, Integer flag, Integer num) throws Exception;

    int updateGoodsStock(Goods goods, Integer flag, Integer num);
}
